package cn.ruituo.adv5;

import cn.ruituo.adv2.Sex;
import cn.ruituo.adv2.Student;

import java.io.*;

public class WriteObject {
    public static void main(String[] args) {
        Student student=new Student();
        student.setAge(23);
        student.setName("杨龙飞");
        student.setSex(Sex.男);
        try {
            ObjectOutputStream  oout=new ObjectOutputStream(new FileOutputStream("72loser.obj"));
            oout.writeObject(student);
            oout.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
